﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:gc="clr-namespace:WickedFlame.VecDraw.Base.Controls">

    <Style TargetType="{x:Type ContentPresenter}" x:Key="ImageStyle">
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=IsEnabled}" Value="False">
                <Setter Property="Opacity" Value="0.50"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    
    <Style TargetType="{x:Type gc:ToolBarIconButton}">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type gc:ToolBarIconButton}">
                    <Border SnapsToDevicePixels="True" BorderBrush="Transparent" BorderThickness="1,1,1,1" CornerRadius="2" Background="Transparent" Name="btnBorder">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Viewbox Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" >
                            
                            <ContentPresenter x:Name="Icon"
													VerticalAlignment="Center"
													ContentSource="Icon"
                                                    HorizontalAlignment="Center"
													SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Style="{StaticResource ImageStyle}" />
                            </Viewbox>
                            
                            <ContentControl Grid.Row="1" Foreground="{TemplateBinding Foreground}" Margin="2" FontSize="7.5" VerticalAlignment="Center">
                                <ContentPresenter
                                    ContentSource="Text"
                                    HorizontalAlignment="Center"
									SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </ContentControl>
                            
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
								 Value="true">
                            <Setter Property="BorderBrush"
                                    Value="#FF565656" TargetName="btnBorder" />
                        </Trigger>
                        <Trigger Property="IsPressed"
								 Value="true">
                            <Setter Property="BorderBrush"
                                    Value="#FF565656" TargetName="btnBorder" />
                        </Trigger>
                        <!--<Trigger Property="IsSelected"
								 Value="true">
                            <Setter Property="BorderBrush"
                                    Value="#FF565656" TargetName="btnBorder" />
                        </Trigger>-->
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>